# -*- coding:utf-8 -*-
__author__ = 'shuxin'
__date__ = '2020/6/13  15:45'

import json

from django.http import HttpResponse
from django.views import View


class OrderExportView(View):
    def post(self, request):
        info = {
            "ResponseBody": {
                "IssueOrderList": [
                    {
                        "Adtk": "/Date(1600328299000+0800)/",
                        "AirlineRecodeNo": "000000",
                        "BillDetailList": [
                            {
                                "ACity": "HKT",
                                "AgencyOfficeNo": "CSD",
                                "AgencyRecodeNo": "WTCY6Z",
                                "AgeType": "ADU",
                                "APort": "HKT",
                                "ArrivalTime": "/Date(1600675800000+0800)/",
                                "BillDetailID": 944753202,
                                "BirthDate": "/Date(631123200000+0800)/",
                                "CardNo": "C12345678",
                                "CardTimelimit": "/Date(1663257600000+0800)/",
                                "CardType": 2,
                                "Class": "Y",
                                "Cost": 142.0,
                                "CostRate": 0.0,
                                "DataChange_LastTime": "/Date(1600243504000+0800)/",
                                "DateChange_CreateTime": "/Date(1600243504000+0800)/",
                                "DCity": "BKK",
                                "DPort": "DMK",
                                "Flight": "FD3007",
                                "Gender": "M",
                                "IssueBillID": 618200389,
                                "Nationality": "CN",
                                "OilFee": 0.0,
                                "PassengerName": "CE/SHI",
                                "PrintPrice": 142.0,
                                "Sequence": 1,
                                "SubClass": "O",
                                "TakeOffTime": "/Date(1600670400000+0800)/",
                                "Tax": 37.0
                            }
                        ],
                        "CancelIssueStatus": 0,
                        "DataChange_CreateTime": "/Date(1600243504000+0800)/",
                        "DataChange_LastTime": "/Date(1600243504000+0800)/",
                        "EIRemark": "",
                        "ExtOrderID": "",
                        "FlightClass": "I",
                        "IssueBillID": 618200389,
                        "IsVIP": False,
                        "IssueRemark": "不可加订婴儿票；；行李额:成人:BKK-HKT:0件。",
                        "IssueStatus": 1,
                        "IssueWay": 2,
                        "LastPrintTicketTime": "/Date(1600663200000+0800)/",
                        "OfficeNo": "CSD",
                        "OrderDate": "/Date(1600241979000+0800)/",
                        "PolicyCode": "FD@BJNZ@0/FD@BJNZ@693671",
                        "PolicyID": 0,
                        "PolicyType": "11018",
                        "RecodeNo": "WTCY6Z",
                        "TicketType": 2,
                        "Urgency": 6,
                        "UrgeTimes": 0,
                        "SaleType": "Cloud",
                        "IntlRebookOrder": "F"
                    }
                ]
            },
            "Header": {
                "ShouldRecordPerformanceTime": False,
                "RequestID": "8e956fa4-2442-463b-8a80-55dbd3f449c5",
                "ResultCode": 0,
                "AssemblyVersion": "2.9.8.0",
                "RequestBodySize": 0,
                "SerializeMode": 0,
                "RouteStep": 1,
                "Environment": "PRO"
            }
        }

        error_info = {
            "status": "F103",
            "msg": "订单状态不正确",
            "orderLists": None
        }

        return HttpResponse(json.dumps(info, ensure_ascii=False), content_type="application/json")
